﻿/*
 * SptlDbParameter
 * 
 * initial implementation : 2.12.2008
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;


namespace Petra.Gis.DataServices
{
  /// <summary>
  /// no comment ;-)
  /// </summary>
  public class SptlDbParameter : DbParameter
  {




    public SptlDbParameter()
      :base() { }




    public SptlDbParameter(string parameterName, DbType dbType, int size, string sourceColumn)
      :this()
    {
      _parameterName = parameterName;
      _dbType = dbType;
      _size = size;
      _sourceColumn = sourceColumn;
    }




    public SptlDbParameter(string parameterName, object value)
      : this()
    {
      _parameterName = parameterName;
      _value = value;
    }




    public SptlDbParameter(string parameterName, DbType dbType)
      : this()
    {
      _parameterName = parameterName;
      _dbType = dbType;
    }




    protected DbType _dbType;


    public override DbType DbType
    {
      get { return (DbType)_dbType; }
      set { _dbType = (DbType)value; }
    }




    protected ParameterDirection _direction = ParameterDirection.Input;

    public override ParameterDirection Direction
    {
      get { return _direction; }
      set { _direction = value; }
    }




    protected bool _isNullable = false;

    public override bool IsNullable
    {
      get { return _isNullable; }
      set { _isNullable = value; }
    }




    protected string _parameterName;

    public override string ParameterName
    {
      get { return _parameterName; }
      set { _parameterName = value; }
    }




    protected object _value;

    public override object Value
    {
      get { return _value; }
      set { _value = value; }
    }




    protected string _sourceColumn;

    public override string SourceColumn
    {
      get { return _sourceColumn; }
      set { _sourceColumn = value; }
    }




    protected int _size;

    public override int Size
    {
      get { return _size; }
      set { _size = value; }
    }




    public override void ResetDbType()
    {
      throw new NotImplementedException();
    }




    protected DataRowVersion _sourceVersion = DataRowVersion.Original;

    public override DataRowVersion SourceVersion
    {
      get { return _sourceVersion; }
      set { _sourceVersion = value; }
    }




    protected bool _sourceColumnNullMapping;

    public override bool SourceColumnNullMapping
    {
      get { return _sourceColumnNullMapping; }
      set { _sourceColumnNullMapping = value; }

    }


  }
}
